package StudyCode.summary.mycollection;

import java.util.*;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class MakeAShallowCopyOfTheSet {
	static Set<String> copyWithout(final Set<String> source,
	                               final Collection<String> removed) {
		final Set<String> copy = new LinkedHashSet<String>(source);
		copy.removeAll(removed);
		return copy;
	}


	static Map<String, String> copyWithout(
			final Map<String, String> source,
			final Collection<String> removed) {
		final Map<String, String> copy = new LinkedHashMap<String, String>(
				source);
		copy.keySet().removeAll(removed);
		return copy;
	}
}
